package com.nearby.android;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;

public class MyView extends View{
	//定义水平仪仪盘图片
	Bitmap back;
	//定义水平仪中的气泡图标
	Bitmap bubble;
	//定义水平仪中气泡的 X、Y坐标
	int bubbleX, bubbleY;
	
	public MyView(Context context, AttributeSet attrs) {
		super(context, attrs);
		
		back = BitmapFactory.decodeResource(getResources(), R.drawable.back);
		bubble = BitmapFactory.decodeResource(getResources(), R.drawable.bubble);
	}
	
	@Override
	protected void onDraw(Canvas canvas){
		super.onDraw(canvas);
		canvas.drawBitmap(back, 0, 0, null);
		canvas.drawBitmap(bubble, bubbleX, bubbleY, null);
	}
}
